home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / clang / mcomm540.zip / EXTRA.H < prev    next >
C/C++ Source or Header  |  1991-01-10  |  2KB  |  63 lines

  1.  
  2. /****************************************************************************
  3.  EXTRA.H -- miscellaneous functions
  4.    Mike Dumdei,  6 Holly Lane,  Texarkana TX  75503    (c) 1989,1990
  5. ****************************************************************************/
  6.  
  7. #if !defined(MCOMM)
  8. #define _C_ cdecl
  9. #define _N_ near
  10. #define _F_ far
  11. #define MCOMM
  12. #endif
  13.  
  14. #if __cplusplus
  15.   extern "C" {
  16. #endif
  17. #if __ZTC__
  18.   #define INTERRUPT
  19. #else
  20.   #define INTERRUPT interrupt
  21. #endif
  22.  
  23. #define SET_TO_TENTHS(to, tenths)   set_timeout((&to), (tenths)*9/5)
  24. #define SET_TO_SECS(to, secs)       set_timeout((&to), (secs)*18)
  25. #define SET_TO_MINS(to, mins)       set_timeout((&to), (mins)*1080)
  26. #define DELAY_TENTHS(tenths)        tdelay((tenths)*9/5)
  27. #define DELAY_SECS(secs)            tdelay((secs)*18)
  28. #define DELAY_MINS(mins)            tdelay((mins)*1080)
  29.  
  30. /* function declarations */
  31. int _C_ calc_crc(char *blk, int blksz);
  32. int _C_ update_crc(int oldcrc, char ch);
  33. int _C_ strcntch(char *str, char ch_to_cnt);
  34. char * _C_ strrstr(char *str1, char *str2);
  35. char * _C_ strpbrkf(char *str1, char *str2);
  36. char * _C_ strrtrim(char *str);
  37. char * _C_ strltrim(char *str);
  38. char * _C_ strtrim(char *str);
  39. char * _C_ strsum(char *, ...);               /* dest, str1, str2, ..., NULL */
  40. char * _C_ strrjust(char *str, int fldwidth, char pad);
  41. char * _C_ strljust(char *str, int fldwidth, char pad);
  42. char * _C_ strcentr(char *str, int fldwidth, char pad);
  43. int _C_ watchdogset(int flag, int commchipadrs);
  44. void INTERRUPT _F_ watchdoghook(void);
  45. int _C_ ctshookset(int flag, int port, int chipadrs);
  46. void INTERRUPT _F_ int14ctshook(void);
  47.  
  48.  /*------- NEW TIMER FUNCTIONS ---------*/
  49. #ifndef TIMER_H
  50. int _C_ tickhookset(int flag); /* MUST disable before exiting program !!!!! */
  51. void _C_ set_timeout(long *timer, unsigned ticks);
  52. void _C_ set_longtimeout(long *timer, long ticks);
  53. int _C_ timed_out(long *timer);
  54. void _C_ tdelay(unsigned ticks);
  55. long _C_ get_ticker(void);
  56. #define TIMER_H
  57. #endif
  58.  
  59. #if __cplusplus
  60.   }
  61. #endif
  62.  
  63.